﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MapData{

    /// <summary>
    /// An object which represents a polygon in a mapping system
    /// </summary>
    public class Polygon : MapObject {
        
        private List<SimplePolygon> polygons;

        private string lineColor;
        private int lineWidth;
        private string fillColor;

        /// <summary>
        /// pre:
        /// post: Creates a Polygon object with default values.
        /// </summary>
        public Polygon() : base() { 
            polygons = new List<SimplePolygon>();
            lineColor = "000000";
            lineWidth = 1;
            fillColor = "FF0000";
        }

        /// <summary>
        /// pre:A SimplePolygon needs to be created and passed to the function
        /// post: Adds a simplepolygon to the Polygon.
        /// </summary>
        /// <param name="polygon"></param>
        public void addPolygon(SimplePolygon polygon) {
            polygons.Add(polygon);
        }

        /// <summary>
        /// pre:
        /// post: Returns Polygon's simplePolygons as an array.
        /// </summary>
        /// <returns></returns>
        public SimplePolygon[] getPolygons() {
            return polygons.ToArray();
        }

        /// <summary>
        /// Pre:
        /// Post: Return or Sets the value of the Polygon's LineColor
        /// </summary>
        public string LineColor {
            get {
                return lineColor;
            }
            set {
                lineColor = value;
            }
        }

        /// <summary>
        /// Pre:
        /// Post: Return or Sets the value of the Polygon's LineWidth
        /// </summary>
        public int LineWidth {
            get {
                return lineWidth;
            }
            set {
                lineWidth = value;
            }
        }

        /// <summary>
        /// Pre:
        /// Post: Return or Sets the value of the Polygon's FillColor
        /// </summary>
        public string FillColor {
            get {
                return fillColor;
            }
            set {
                fillColor = value;
            }
        }
    }
}
